package com.example.droolstest.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

/**
 * 业务规则模板
 */
@Data
@TableName(value = "business_rule_temp")
public class BusinessRuleTemp {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField(value = "name")
    private String name;

    @TableField(value = "rule_temp")
    private String ruleTemp = "\n" +
            "\n" +
            "rule \"${ruleCode}\"\n" +
            "    when\n" +
            "        $map:Map(${criteria})\n" +
            "    then\n" +
            "        $map.put(\"result\", ${result});\n" +
            "\n" +
            "end\n" +
            "\n";

    @TableField(value = "import_package")
    private String importPackage = "import java.util.Map\n\n";



    public static final String COL_ID = "id";
    public static final String COL_NAME = "name";
    public static final String COL_RULE_TEMP = "rule_temp";
    public static final String COL_IMPORT_PACKAGE = "import_package";

}
